package com.xq.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xq.entity.BizProduct;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (BizProduct)表数据库访问层
 *
 * @author makejava
 * @since 2020-08-11 19:51:15
 */
public interface BizProductDao extends BaseMapper<BizProduct> {
    /**
     * 查询订单详细信息
     * @param queryWrapper
     * @return
     */
    @Select("select \n" +
            "prod.`name`,prod.p_num as pNum,prod.model,prod.image_url,ost.product_number as number,prod.unit\n" +
            "from biz_out_stock ost left JOIN biz_product prod on ost.out_num=prod.p_num ${ew.customSqlSegment}")
    List<BizProduct> findByPro(@Param(Constants.WRAPPER) QueryWrapper<BizProduct> queryWrapper);
}